<template>
	<view class="uni-status-bar">
		<slot />
	</view>
</template>

<script>
	// var statusBarHeight = uni.getSystemInfoSync().statusBarHeight
	// var immersed = 0;
	// var ms=(/Html5Plus\/.+\s\(.*(Immersed\/(\d+\.?\d*).*)\)/gi).exec(navigator.userAgent);
	// if(ms&&ms.length>=3){ // 当前环境为沉浸式状态栏模式
	// console.log(ms+'-----------------------')
	// 	immersed=parseFloat(ms[2]);// 获取状态栏的高度
	// }
	// var statusBarHeight=immersed;
	export default {
		name: 'UniStatusBar',
		data() {
			return {
				statusBarHeight: 20
			}
		}
	}
</script>

<style lang="scss" scoped>
	.uni-status-bar {
		// width: 750rpx;
		// height: 20px;
		/* #ifndef APP-PLUS */
		padding-top: calc(44rpx + var(--status-bar-height));
		/* #endif */
		height: var(--status-bar-height);
	}
</style>
